<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width:100px;
            height:100px;
            background: #fc8;
            margin:100px auto;
        }
        .ani1-enter{
            transform:translateX(-500px) rotate(720deg);
            opacity:0;
        }
        .ani1-enter-active{
            transition:all 5s;
        }
        .ani1-leave-to{
            transform: translateY(500px) rotate(360deg);
            opacity:0;
        }
        .ani1-leave-active{
            transition:all 5s;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="change">
            显示、消失
        </button>
        <transition name="ani1">
            <div class="box" v-if="isShow"></div> 
        </transition>
          
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                isShow:false
            },
            methods:{
                change(){
                    this.isShow = !this.isShow
                }
            }
        })
    </script>
</body>
</html>